let Promise = require('./promise')

let p1 = new Promise((resolve, reject) => {
    resolve(100)
    // reject(100)
})

let p2 = p1.then(data => {
    // return new Promise((resolve, reject) => {
    //     setTimeout(() => {
    //         resolve('ok')
    //     }, 1000);
    // })
    throw new Error()
}, err => {
    return '失败'
})
p2.then(data => {
    console.log(data, '*****')
})